//
//  StockLabel.m
//  MyStock
//
//  Created by 刘翔 on 2024/11/5.
//

#import "StockLabel.h"

@implementation StockLabel


- (void)setCode:(NSString *)code{
    _code = code;
    [self xw_addNotificationForName:code block:^(NSNotification * _Nonnull notification) {
        NSDictionary *dic = notification.userInfo;
        StockModel *model = [StockModel mj_objectWithKeyValues:dic];
        if (self.stockChangeHandle) {
            self.stockChangeHandle(model);
        }
    }];    
}


- (void)dealloc
{
    [[NSNotificationCenter defaultCenter] xw_removeAllNotification];
}

@end
